import { commonRouter } from '@/router/route'
import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: commonRouter,
})

router.beforeEach(() => {
  window.$loadingBar?.start()
  return true
})

router.afterEach(() => {
  window.$loadingBar?.finish()
})

export default router
